package com.sxj.PDMS.mapper;

import com.sxj.PDMS.model.entity.Message;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.Date;
import java.util.List;

/**
* @author 503c'j
* @description 针对表【message】的数据库操作Mapper
* @createDate 2024-06-15 20:48:06
* @Entity com.sxj.PDMS.model.entity.Message
*/
public interface MessageMapper extends BaseMapper<Message> {
    /**
     * 查询所有数据,分页展示
     *
     * @param start
     * @param pageSize
     * @return
     */
    @Select("select * from message limit #{start},#{pageSize}")
    List<Message> selectAll(@Param("start") Integer start,
                            @Param("pageSize") Integer pageSize);
    @Select("select count(*) from message")
    Long selectTotal();

    List<Message> selectByTitleOrMessageOrAdminIdOrStudentNumber(@Param("start") Integer start,
                                                          @Param("pageSize") Integer pageSize,
                                                          @Param("title") String title,
                                                          @Param("message") String message,
                                                          @Param("time") Date time,
                                                          @Param("adminId") String adminId,
                                                          @Param("studentNumber") String studentNumber);

    Long selectTotalByTitleOrMessageOrAdminIdOrStudentNumber(@Param("title") String title,
                                                            @Param("message") String message,
                                                             @Param("time") Date time,
                                                            @Param("adminId") String adminId,
                                                            @Param("studentNumber") String studentNumber);
}




